home *** CD-ROM | disk | FTP | other *** search
- Path: lantana.singnet.com.sg!usenet
- From: mikhail@singnet.com.sg (Mikhail Choo W.M.)
- Newsgroups: comp.lang.c++
- Subject: how to delete data in file? help
- Date: Tue, 05 Mar 1996 03:53:11 GMT
- Organization: Singapore Telecom Internet Service
- Message-ID: <4helpk$50c@lantana.singnet.com.sg>
- NNTP-Posting-Host: ts900-2823.singnet.com.sg
- X-Newsreader: Forte Free Agent 1.0.82
-
- HI there,
- I know this may seem like a real stupid question, but I had to ask. If say
- for example I needed to delete a string of data form a file, how do I go about
- doing it. I can't just write over the data to delete, because the result would
- be a file of the same length with white space chracters. So how does one delete
- the data in such a way that once the data segment is deleted, the rest of the
- data would neatly pack themselves over the deleted area to ensure a release of
- space. I know one way to solve the problem, but it seems very long-winded. The
- method involves reading all the data in the file to memory, deleteing the
- unwanted area, and the re-write the data back to clean file. I am currently
- using Borland C++ 4.5, and I can't find any function that does the job. OK OK,
- to summerise, the problem is that I can't seem to find a way to directly delete
- a data segment form a file, without reading into memory first. So any ideas, and
- help would be greatly appreciated. Thanks in advance .
- --------------------------------------------------------
- Yours, Mikhail Choo W. M.
- Carpedium!
- E-Mail: mikhail@singnet.com.sg sieze the day...
- s7700017@singnet.com.sg
- --------------------------------------------------------
-
-